unit LDSPanel;

interface
uses
  Windows, Sysutils, Messages, Classes, Controls, StdCtrls, Math, Buttons,
  Graphics, Forms, DB, AYUtils, Menus, DBGrids, CHConst, ExtCtrls,
  CHImage,LDSCheckBox;

type
   TLDSCustomPanel= class(TCHPanel)
   private
    FEditCheckBox : TLDSCheckBox;
    FXH : Integer;
    function GetXH: Integer;
    procedure SetXH(const Value: Integer);
   protected
    procedure SetName(const Value: TComponentName); override;
    procedure SetParent(AParent: TWinControl); override;
   public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;

    property XH : Integer  read GetXH write SetXH;
   public

  end;

  TLDSPanel= class(TLDSCustomPanel)
  published
    property DesignState;
    property XH;
  end;

implementation

{ TLDSCustomPanel }

constructor TLDSCustomPanel.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FEditCheckBox := TLDSCheckBox.Create(AOwner);
  FEditCheckBox.Caption := 'qqqqqqqqqqqqqqqqqq';

end;

destructor TLDSCustomPanel.Destroy;
begin
  FEditCheckBox.Free;
  inherited Destroy;
end;

function TLDSCustomPanel.GetXH: Integer;
begin
  Result := FXH;
end;

procedure TLDSCustomPanel.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
begin
  inherited SetBounds(ALeft, ATop, AWidth, AHeight);
  if Assigned(FEditCheckBox) then
  begin
    with FEditCheckBox do
    begin
      SetBounds(ALeft-Width,ATop,Width,Height);
    end;
  end;
end;

procedure TLDSCustomPanel.SetName(const Value: TComponentName);
begin
  inherited SetName(Value);

end;

procedure TLDSCustomPanel.SetParent(AParent: TWinControl);
begin
  inherited SetParent(AParent);
  if not Assigned(FEditCheckBox) then exit;
  FEditCheckBox.Parent := AParent;
end;

procedure TLDSCustomPanel.SetXH(const Value: Integer);
begin
  FXH := Value;
end;

end.
